//
// Created by nilyang on 2021/11/26.
//

#ifndef BASIC_STRING_H
#define BASIC_STRING_H
#include <string>
#include <memory>
struct String {
protected:
    char *cstr;
public:
    explicit String(const char *str);

    String(const String &);

    String &operator=(const String &rhs);

    String(String &&rhs) noexcept;

    String &operator=(String &&rhs) noexcept;

    [[nodiscard]] const char *getCstr() const {
        return cstr;
    }

    ~String();

    ///  string literal operator
    friend String operator "" _s(const char *str, std::size_t len);
};

void func_literal_operator();
template<typename T> auto func_gramma_auto(T &&);

#endif //BASIC_STRING_H
